<%-- 
    Document   : ViewItem
    Created on : Dec 4, 2012, 2:05:27 PM
    Author     : NGUYEN DANG
--%>

<%@page import="All.DTO.SanphamDTO"%>
<%@page import="All.utility.UserManagerProperties"%>
<%@page import="All.DTO.AccountBean"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%
        AccountBean user = (AccountBean) session.getAttribute("UserBean");
	if ((user == null) || (!user.getRole().equals(UserManagerProperties.ADMIN_ROLE))) {
		response.sendRedirect("./DangNhap.jsp");
	}
	SanphamDTO sanphamDTO = (SanphamDTO) request.getAttribute("sanphamDTO");
        
%>
<!DOCTYPE html>
<html>
    <head>
        <title>View News</title>
        <meta name="description" content="website description" />
        <meta name="keywords" content="website keywords, website keywords" />
        <link rel="stylesheet" type="text/css" href="./css/style.css" />
        <!-- modernizr enables HTML5 elements and feature detects -->
        <script type="text/javascript" src="./js/modernizr-1.5.min.js"></script>
        <script type="text/javascript" src="./editor/ckeditor.js" ></script>
    </head>    
    <body>
        <div id="main">
            <header>
                <jsp:include page="./file/header.jsp"></jsp:include>
            </header>
            <div id="site_content">
                <jsp:include page="./file/LeftMenu.jsp"></jsp:include>
                <div class="content">
                    <form id="contact" action="./UpdateItemServlet?matin=<%=sanphamDTO.getMatintuc()%>&id=<%=sanphamDTO.getNhomsanpham()%> "method="post">                       
                            <table border="0" cellpadding="0" cellspacing="0" align="center">
                                <tr>
                                        <td colspan="2"><h1>News Detail</h1></td>
                                        <td></td>
                                </tr>
                                <tr>
                                        <td>Tiêu Đề</td>
                                        <td>
                                                <input type="text" name="txtTieude" value="<%=sanphamDTO.getTieude()%>">
                                        </td>
                                        <td></td>
                                </tr>
                                <tr>
                                        <td>Tóm Tắt</td>
                                        <td>
                                            <textarea class="contact textarea" rows="5" cols="50" name="txtTomtat">
                                                <%=sanphamDTO.getTomtat()%>
                                            </textarea>
                                        </td>
                                        <td>
                                </tr>
                                <tr>
                                        <td>NộiDung</td>
                                        <td>
                                            <textarea class="contact textarea" rows="5" cols="50" name="txtNoidung" id="txtNoidung">
                                                <%=sanphamDTO.getNoidung()%>
                                            </textarea>
                                            <script>
                                                CKEDITOR.replace( 'txtNoidung' );                                   
                                            </script>
                                        </td>
                                        <td></td>
                                </tr>
                                <tr>
                                        <td>Hình Ảnh</td>
                                        <td>
                                                <input type="text" name="txtHinhanh" value="<%=sanphamDTO.getHinhanh()%>">
                                                <input type="file" name="txtSelectImg" value="" />
                                        </td>
                                        <td></td>
                                </tr>
                                <tr>
                                        <td>Ngày Đăng</td>
                                        <td>
                                                <input type="text" name="txtNgaydang" value="<%=sanphamDTO.getNgaydang()%>" >
                                        </td>
                                        <td></td>
                                </tr>
                                <tr>
                                        <td>Nhóm Sản Phẩm</td>
                                        <td>
                                                <input type="text" name="txtTheloai" value="<%=sanphamDTO.getNhomsanpham()%>">
                                        </td>
                                        <td></td>
                                </tr>
                                <tr>
                                        <td>Người Đăng</td>
                                        <td>
                                                <input type="text" name="txtNguoidang" value="<%=sanphamDTO.getUserid()%>">
                                        </td>
                                        <td></td>
                                </tr>                               
                                <tr>
                                        <td></td>
                                        <td>
                                                <input type="button" value="Back" onclick="history.back();">
                                                <input type="submit" value="Save" name="btnUpdate" class="submit">
                                        </td>
                                        <td></td>
                                </tr>
                        </table>
                        
                    </form>
                </div>
            </div>           
            <footer>
                <jsp:include page="./file/footer.jsp"></jsp:include>
            </footer>
        </div>
        <p>&nbsp;</p>
  <!-- javascript at the bottom for fast page loading -->
  <script type="text/javascript" src="./js/jquery.js"></script>
  <script type="text/javascript" src="./js/jquery.easing-sooper.js"></script>
  <script type="text/javascript" src="./js/jquery.sooperfish.js"></script>
  <script type="text/javascript" src="./js/image_fade.js"></script>
  <script type="text/javascript">
    $(document).ready(function() {
      $('ul.sf-menu').sooperfish();
    });
  </script>
    </body>
</html>
